Allow scoped Thread Debug operator access - #2630
Draft
3mdistal wants to merge 1 commit into
Draft
Conversation
Contributor
Visual recap — skippedThe visual recap job did not run for this pull request. This is informational only and does not block the PR. Recap skipped for |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Slack-triggered runs are stored under a service-principal owner such as
integration@slack. Thread Debug previously limited ordinary members to their own human-owned Dispatch threads, so a Builder operator could not inspect an organization-owned Slack-to-Content trace without broader Dispatch admin access. Failed or unavailable lookups could also appear as successful zero-result searches, hiding the distinction operators needed most.Approach
Add a dedicated read-only Thread Debug operator permission. Cross-app organization IDs are local to each app, so the selected source resolves the caller's active organization through its stable allowed domain and permits the trace query only when that mapping identifies exactly one target organization. Service-principal ownership is then an optional filter inside that organization boundary—not a fake human membership.
This permission applies only to the existing read-only Thread Debug actions and does not grant any Dispatch mutation capability.
What changed
DISPATCH_THREAD_DEBUG_OPERATOR_EMAILSas a narrow operator allowlist for callers with an active organization.Safety and operations
DISPATCH_THREAD_DEBUG_OPERATOR_EMAILSbefore the production canary can exercise the new path.Verification
pnpm --filter @agent-native/dispatch test— 61 files and 349 tests passed, covering the exact Slack canary marker shape, organization-owned service principals, zero and duplicate organization mappings, explicit 403 propagation, genuine empty results, and mixed unavailable results.pnpm --filter @agent-native/dispatch typecheck— passed.pnpm guards— all repository guards passed.Review focus